package com.disease.chronic.Mappers;

import com.disease.chronic.pojo.DailySuggest;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.sql.Date;
import java.util.List;

public interface DailySuggestMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(DailySuggest record);

    int insertSelective(DailySuggest record);

    @Select("SELECT ID, DIET, DAY, SPORTS, REST, USERNAME FROM \"DAILYSUGGEST\" WHERE USERNAME = #{username}")
    List<DailySuggest> selectAllDailySuggestByUsername(@Param("username") String username);

    @Select("SELECT ID, DIET, DAY, SPORTS, REST, USERNAME FROM \"DAILYSUGGEST\" " +
            "WHERE USERNAME = #{username} AND DAY = #{day}")
    DailySuggest selectByUsernameAndDay(@Param("username") String username, @Param("day") Date day);

    DailySuggest selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(DailySuggest record);

    int updateByPrimaryKey(DailySuggest record);
}
